﻿<!DOCTYPE html>
<html>
<head>
    <title>@ViewBag.Title</title>
    <link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" type="text/css" href="@Url.Content("~/Content/css/font-awesome.css")" />
    <link rel="stylesheet" type="text/css" href="@Url.Content("~/Content/css/light-accord/css/liteaccordion.css")" />
    <link rel="stylesheet" type="text/css" href="@Url.Content("~/Content/css/navbar-override-2.css")" />
    <link rel="stylesheet" type="text/css" href="@Url.Content("~/Content/css/custom.css")" />
    <link rel="stylesheet" type="text/css" href="@Url.Content("~/Content/css/modern.css")" />
    <link rel="stylesheet" type="text/css" href="@Url.Content("~/Content/css/fancybox/jquery.fancybox.css")"/>
    <link rel="stylesheet" type="text/css" href="@Url.Content("~/Content/css/jrating/jRating.jquery.css")">
    <link rel="stylesheet" type="text/css" href="@Url.Content("~/Content/css/jquery.toastmessage.css")">
    
    <script type="text/livescript" src="@Url.Content("~/Scripts/jquery-1.9.1.js")"></script>
    <script type="text/javascript" src="@Url.Content("~/Scripts/dropdown.js")"></script>
    <script type="text/javascript" src="@Url.Content("~/Scripts/jquery.easing.1.3.js")"></script>
    <script type="text/javascript" src="@Url.Content("~/Scripts/liteaccordion.jquery.js")"></script>
    <script type="text/javascript" src="@Url.Content("~/Scripts/jquery.fancybox.js")"></script>
    <script type="text/javascript" src="@Url.Content("~/Scripts/jquery.carouFredSel-6.2.1.js")"></script>
    <script type="text/javascript" src="@Url.Content("~/Scripts/jRating.jquery.js")"></script>
    <script type="text/javascript" src="@Url.Content("~/Scripts/jquery.toastmessage.js")"></script>
</head>
<body class="metrouicss">
    <div class="wrapper">
        <div class="container top-container">
            <div class="nav-bar">
                <div class="nav-bar-inner">
                    <span class="element">Product Name</span> <span class="divider"></span>
                    <ul class="menu">
                        <li data-role="dropdown"><a href="#">Item 1</a>
                            <ul class="dropdown-menu">
                                <li><a href="#">SubItem</a></li>
                                <li><a href="#">SubItem</a></li>
                            </ul>
                        </li>
                        <li><a /></li>
                        <li class="divider"></li>
                        <li><a /></li>
                    </ul>
                </div>
            </div>
        </div>
        <div class="container">
            @RenderBody()
        </div>
    </div>
</body>
<script type="text/javascript">    
    $('#login_form').submit(function () {
            $('#btnClose').click();        
            $.post("@Url.Action("Login", "Home")",
            {
                username: $('#username').val(),
                password: $('#passwd').val()
            },
            function(data,status,xhr){
                if(data.Success){
                        if(data.GoAdmin){
                            if(data.GoReset){
                                window.location.href = "/Admin/ChangePasswordAdmin/?username="+data.Uname;
                            }
                            else{
                            window.location.href = "/Admin/Index";
                            }
                        }
                        else{
                            $('#loginregion').load("@Url.Action("GetLoginButton", "Home")");
                            $().toastmessage('showSuccessToast', "Đăng nhập thành công...");
                             if(data.Reload){
                                   location.reload();
                            }
                       }
                }else{
                    $('#login-mess').html(data.Message);
                    $('#passwd').val("");
                    $('#linkLogin').click();
            }
            });
            return false;
        });

    $('#forgot_password').submit(function(){
        $('#btnClose').click();        
            $.post("@Url.Action("ForgotPassword", "Home")",
            {
                username: $('#cusname').val(),
                email: $('#cusmail').val()
            },
            function(data,status,xhr){
            if(data.Success){
                $().toastmessage('showSuccessToast', "Một email đã được gửi để bạn khôi phục mật khẩu...");
            }
            });
        $('#swich').click();
        return false;
    });
</script>
</html>
